#include "sock.h"
#pragma comment(lib, "WS2_32")	//link WS2_32.lib

int init_sock(BYTE minor_ver = 2, BYTE major_ver = 2)
{
	//init WS2_32.dll
	WSADATA wsa_data;
	WORD sock_version = MAKEWORD(minor_ver, major_ver);
	if (::WSAStartup(sock_version, &wsa_data) != 0)
	{
		return 0;
	}
	return 1;
}

void cleanup_sock()
{
	::WSACleanup();	
}